function AllReady(){
    const mstform = Ext.getCmp("PayPlanPc")
    

    //根据项目过滤合同
    //主表通用帮助过滤
    mstform.getItem('user_cnt_id').on('beforetriggerclick', function (eOp, ignoreBeforeEvent) {
         return cntMFilter()
    });
    mstform.getItem('user_cnt_id').on('helpselected', function (eOp, ignoreBeforeEvent) {
        getCntCz()
        getCntMInfoByPhid()
        getIncomeInspectionSum()
   });
    function cntMFilter(){
        var PhidPc = mstform.getItem('PhidPc').getValue();
        if (!(Number(PhidPc) || 0)) {
            Ext.Msg.alert('提示', '请先选择项目！');
            mstform.getItem('PhidPc').focus();
            return false;
        } else {
            mstform.getItem('user_cnt_id').setOutFilter({
                phid_pc: PhidPc, //phid_pc 字段是通用帮助中的字段
                bill_type:1
            });
            return true
        }
    }
    //获取合同产值
    function getCntCz(){
        if(!mstform.getItem("user_cnt_id").getValue()) return 
        console.log(mstform.getItem("user_cnt_id").getValue());
        execServer("getCntCz",{phid_cnt:mstform.getItem("user_cnt_id").getValue()},(res)=>{
            console.log(res);
            if(res.count==0) return 
            const _data = JSON.parse(res.data)[0].extendObjects
            console.log(_data);
            mstform.getItem("user_cnt_cz").setValue(_data.amt_sum)
        })
    }

    function getCntMInfoByPhid() {
        execServer("getCntMInfoByPhid", { phid: mstform.getItem("user_cnt_id").getValue() }, function (res) {
          const datas = JSON.parse(res.data)[0].extendObjects;
          console.log(datas);
          mstform.getItem("user_cnt_amt").setValue(datas.cnt_sum_vat_fc)
        });
      }

      function getIncomeInspectionSum() {
        execServer("getIncomeInspectionSum", { phid_pc: mstform.getItem("PhidPc").getValue() }, function (res) {
          const datas = JSON.parse(res.data)[0].extendObjects;
          console.log(datas);
          mstform.getItem("user_cnt_srby").setValue(datas.u_by_amt )
        });
      }
}